import os,sys
#os.system('py manage.py')

def f1(cmd):
    return cmd+'1'

def exit_with_help():
    print 'Usage: python import_narrowPeak.py importList'
    exit(1)

if len(sys.argv)<2:
    exit_with_help()

fi=open(sys.argv[1],'r')
i=0
for line in fi:
    line=line.strip()
    if len(line)<1:
    	continue
    i+=1
    cmd='py ../gis-basic-storage/console/bcs.py load mongodb_table -F encodeNarrowPeak:encodeNarrowPeak --tags=\'assembly=hg19;UCSC_name='+line+'\' -i ./narrowPeak/'+line+'.narrowPeak'
    #print cmd
    os.system(cmd)
    #if i>5:
    #	break
fi.close()
